package com.szhuang.mobilesafe.activity;
import android.app.Activity;
import java.util.ArrayList;

import com.szhuang.mobilesafe.R;
import com.szhuang.mobilesafe.adapter.MyPagerAdapter;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Vibrator;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

/**
 * chw
 */

public class MainActivity extends Activity {

    ArrayList<ImageInfo> data;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initData();

        ViewPager vpager = (ViewPager) findViewById(R.id.vPager);
        vpager.setAdapter(new MyPagerAdapter( MainActivity.this,data));
        vpager.setPageMargin(50);
    }

    private void initData() {
        data = new ArrayList<ImageInfo>();
        data.add(new ImageInfo("手机防盗", R.drawable.safe));
        data.add(new ImageInfo("通讯卫士", R.drawable.callmsgsafe));
        data.add(new ImageInfo("软件管理", R.drawable.app));
        data.add(new ImageInfo("进程管理", R.drawable.taskmanager));
        data.add(new ImageInfo("流量统计", R.drawable.netmanager));
        data.add(new ImageInfo("手机杀毒", R.drawable.trojan));
        data.add(new ImageInfo("缓存清理", R.drawable.sysoptimize));
        data.add(new ImageInfo("高级工具",R.drawable.atools));
        data.add(new ImageInfo("设置中心", R.drawable.settings));
        data.add(new ImageInfo("信息设置", R.drawable.tabicon_sms_record_normal));
        data.add(new ImageInfo("恶意广告拦截", R.drawable.title_bar_set_logout));
        data.add(new ImageInfo("交通趋势", R.drawable.traffic_list_unchecked));
        data.add(new ImageInfo("内存监控", R.drawable.traffic_main_unchecked));
        data.add(new ImageInfo("防火墙", R.drawable.traffic_main_unchecked));
        data.add(new ImageInfo("交通趋势", R.drawable.traffic_list_unchecked));
        data.add(new ImageInfo("内存监控", R.drawable.traffic_main_unchecked));
        data.add(new ImageInfo("防火墙", R.drawable.traffic_main_unchecked));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    public class ImageInfo {
        public String imageMsg;
        public int imageId;

        public ImageInfo(String msg, int id) {
            imageId = id;
            imageMsg = msg;
        }
    }




}
